autoReverse = params.autoReverse;
delete params.autoReverse;
+ // repeatCount doesn't include the initial iteration
+ const numIterations = repeatCount + 1;
+ // whether the transition should finish where it started
+ const isReversed = autoReverse && numIterations % 2 === 0;
+
if (params.mode != undefined)
actor.set_easing_mode(params.mode);
delete params.mode;
let animatedProps = Object.keys(params).map(p => p.replace('_', '-', 'g'));
animatedProps.forEach(p => actor.remove_transition(p));
- actor.set(params);
+ if (actor.get_easing_duration() > 0 || !isReversed)
+ actor.set(params);
actor.restore_easing_state();
let transition = animatedProps.map(p => actor.get_transition(p))
autoReverse = params.autoReverse;
delete params.autoReverse;
+ // repeatCount doesn't include the initial iteration
+ const numIterations = repeatCount + 1;
+ // whether the transition should finish where it started
+ const isReversed = autoReverse && numIterations % 2 === 0;
+
// Copy Clutter's behavior for implicit animations, see
// should_skip_implicit_transition()
if (actor instanceof Clutter.Actor && !actor.mapped)
if (duration == 0) {
let [obj, prop] = _getPropertyTarget(actor, propName);
- obj[prop] = target;
+
+ if (!isReversed)
+ obj[prop] = target;
Meta.disable_unredirect_for_display(global.display);
callback(true);